package com.yyk.yykywd.mvvm.view_model

import androidx.lifecycle.MutableLiveData
import com.yyk.yykywd.bean.BaseBean
import com.yyk.yykywd.mvvm.entity.PotentialCustomerBean
import com.yyk.yykywd.mvvm.model.CustomerModel

/**
 * 文件描述：
 * Created by guo on 2019-11-22.
 */
class PotentialCustomerViewModel : BaseViewModel() {
    var customerViewModel = CustomerModel()
    var id: String = ""
    var type: String = ""
    var potentials: MutableList<PotentialCustomerBean.Data> = ArrayList()

    var potentialCustomers = MutableLiveData<PotentialCustomerBean>()

    fun getList(customer_type: Int, customer_scope: Int) {
        customerViewModel.getPotentialCustomers(customer_type,customer_scope,type, page.toString(), num.toString(), object : CustomerModel.GetPotentialCustomers {
            override fun getInfo(info: PotentialCustomerBean) {
                info.data?.let { potentials.addAll(it) }
                potentialCustomers.value = info
            }

            override fun onError(e: String) {
            }

        })
    }
}